/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package graphicsystem;


/**
 *
 * @author DiegoAl
 */
public class Point {
    private double abcissa;
    private double ordinate;
    
    public Point(double abs,double ord) throws InvalidPoints{
        if(abs >= 0 && ord >=0){
            this.abcissa=abs;
            this.ordinate=ord;
        }else{
            throw new InvalidPoints();
        }
    }

    public double getAbcissa() {
        return abcissa;
    }

    public void setAbcissa(double abcissa) {
        this.abcissa = abcissa;
    }

    public double getOrdinate() {
        return ordinate;
    }

    public void setOrdinate(double ordinate) {
        this.ordinate = ordinate;
    }
    public double distance (Point p){
        double distance;
        distance=Math.sqrt(Math.pow(this.getAbcissa()+p.abcissa, 2)+
                Math.pow(this.getOrdinate()+p.ordinate, 2));
        return distance;
    }
    
}
